package cn.zw.design.observer;


public class Observer3 implements Observer,DisplayElements {

	private  float temp;
	private float pressure;
	private float humidity;
	
	private Subject subject;

	public Observer3(Subject weatherData) {
		this.subject = weatherData;
		subject.registerObserver(this);
	}
	
	@Override
	public void display() {
		System.out.println(this.getClass().getSimpleName() + " display ---> temp: " + humidity);
	}

	@Override
	public void update(float _temp, float _pressure, float _humidity) {
		this.pressure = _pressure;
		this.temp = _temp;
		this.humidity = _humidity;
		display();
		
	}

}
